package com.heer.gymnasium.module.main.beans;

import com.heer.gymnasium.module.advise.beans.AdMainBean;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by yan
 * on 2018/1/31
 */

public class BannerResponseBean {
    private String id;
    private String title;
    private String link_url;
    private String images;
    private String ad_position_id;
    private String foreign_id;
    private String oreign_type;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getLink_url() {
        return link_url;
    }

    public void setLink_url(String link_url) {
        this.link_url = link_url;
    }

    public String getImages() {
        return images;
    }

    public void setImages(String images) {
        this.images = images;
    }

    public String getAd_position_id() {
        return ad_position_id;
    }

    public void setAd_position_id(String ad_position_id) {
        this.ad_position_id = ad_position_id;
    }

    public String getForeign_id() {
        return foreign_id;
    }

    public void setForeign_id(String foreign_id) {
        this.foreign_id = foreign_id;
    }

    public String getOreign_type() {
        return oreign_type;
    }

    public void setOreign_type(String oreign_type) {
        this.oreign_type = oreign_type;
    }

    /**
     * 数据转换
     *
     * @param data
     * @return
     */
    public static List<AdMainBean> dataChange(List<BannerResponseBean> data) {
        List<AdMainBean> adMainBeanList = new ArrayList<>();
        if (data != null && data.size() > 0) {
            for (int i = 0; i < data.size(); i++) {
                BannerResponseBean bannerResponseBean = data.get(i);
                AdMainBean adMainBean = new AdMainBean();
                adMainBean.setTitle(bannerResponseBean.getTitle());
                adMainBean.setLink_url(bannerResponseBean.getLink_url());
                adMainBean.setImages(bannerResponseBean.getImages());
                adMainBean.setAd_position_id(bannerResponseBean.getAd_position_id());
                adMainBean.setForeign_id(bannerResponseBean.getForeign_id());
                adMainBean.setOreign_type(bannerResponseBean.getOreign_type());
                adMainBeanList.add(adMainBean);
            }
        }
        return adMainBeanList;
    }
}
